# Maintainer: Antonio Rojas <arojas@archlinux.org>

pkgname=ttf-croscore
pkgver=20220810
_commit=2725c70baa8b0176c7577093ba1fc6179aa79478
pkgrel=2
pkgdesc='Chrome OS core fonts'
arch=(any)
url='https://fonts.google.com/noto'
license=(custom:SIL)
provides=(ttf-font)
makedepends=(git python-fonttools)
source=(git+https://github.com/notofonts/noto-fonts#commit=$_commit)
sha256sums=('SKIP')

prepare() {
# Fix weight of Arimo-BoldItalic.ttf https://github.com/googlefonts/noto-fonts/issues/2350
  cd noto-fonts/hinted/ttf/Arimo
  ttx Arimo-BoldItalic.ttf
  sed -e 's|usWeightClass value=\"400\"|usWeightClass value=\"700\"|' -i Arimo-BoldItalic.ttx
  ttx -f Arimo-BoldItalic.ttx
}

package() {
  cd noto-fonts
  install -Dm644 hinted/ttf/{Arimo,Cousine,Tinos}/*.ttf -t "$pkgdir"/usr/share/fonts/croscore
  install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/ttf-croscore
}
